import multiprocessing
import os


class MyProcess(multiprocessing.Process):
	def __init__(self, max):
		self.max = max
		super().__init__()

	def run(self):
		for i in range(self.max):
			print("child pid is -->", os.getpid(), "current is -->", i)


if __name__ == '__main__':
	for i in range(100):
		print("main process pid -->", os.getpid(), "i is -->", i)
		if i == 20:
			mp1 = MyProcess(100)
			mp1.start()
			mp2 = MyProcess(100)
			mp2.start()
	print("main process finish")
